/*
 * @LastEditors: yuSeen
 * @LastEditTime: 2021-12-23 15:12:10
 * 天凉好个秋
 */
import { createRouter, createWebHistory, createWebHashHistory, RouteRecordRaw } from "vue-router";
import { batchImportAsArr } from '@/utils/util'
import Layout from '@/layout/layout.vue'

// 批量导入路由
const module = import.meta.globEager('./routes/**/*.ts');
const routeModules = batchImportAsArr(module) as RouteRecordRaw[]

const routes: RouteRecordRaw[] = [
  {
    path: "/",
    component: Layout,
    redirect: "/foundMusic/foundMusic/recommend"
  },
  ...routeModules
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
